package com.cmii.sjw.department.control.jsc.controller;

import com.cmii.sjw.department.control.jsc.model.UniversityDataCollection;
import com.cmii.sjw.department.control.jsc.model.dto.UniversityDataCollectionDTO;
import com.cmii.sjw.department.control.jsc.service.UniversityDataCollectionService;
import com.cmii.sjw.department.control.jsc.util.Result;
import org.springframework.web.bind.annotation.*;

import jakarta.annotation.Resource;
import java.util.List;

/**
 * 高校数据归集与共享统计表
 *
 * @author lizheng
 * @date 2025-07-16
 */
@RestController
@CrossOrigin
@RequestMapping("/collection")
public class UniversityDataCollectionController {

    @Resource
    private UniversityDataCollectionService universityDataCollectionService;

    /**
     * 高校数据归集与共享统计表
     *
     * @return 列表
     */
    @PostMapping("/list")
    public Result<List<UniversityDataCollection>> list() {
        List<UniversityDataCollection> list = universityDataCollectionService.list();
        return Result.success(list);
    }
    /**
     * 数据归集与共享统计
     *
     * @return 统计数据
     */

    @PostMapping("/stats")
    public Result<UniversityDataCollectionDTO> getStats() {
        UniversityDataCollectionDTO stats = universityDataCollectionService.getCollectionStats();
        return Result.success(stats);
    }
}
